import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:sainbainu/common/values/colors.dart';

final ThemeData appTheme = ThemeData(
  appBarTheme: const AppBarTheme(
    backgroundColor: AppColors.nav,
    foregroundColor: AppColors.active,
    centerTitle: true,
    elevation: 0,
    titleTextStyle: TextStyle(fontSize: 17, color: Colors.black),
    iconTheme: IconThemeData(size: 22),
    // 滚动时出现阴影
    scrolledUnderElevation: 4,
    surfaceTintColor: AppColors.nav,
    shadowColor: Colors.black12,
  ),
  tabBarTheme: const TabBarTheme(
    indicatorColor: AppColors.active,
    indicatorSize: TabBarIndicatorSize.label,
    indicator: UnderlineTabIndicator(
      borderRadius: BorderRadius.all(Radius.circular(4)),
      borderSide: BorderSide(color: AppColors.active, width: 2.5),
    ),
    labelColor: AppColors.active,
    unselectedLabelColor: AppColors.unactive,
    splashFactory: NoSplash.splashFactory,
    overlayColor: MaterialStatePropertyAll(Colors.transparent),
    labelStyle: TextStyle(fontWeight: FontWeight.w600, fontSize: 15),
    unselectedLabelStyle: TextStyle(fontWeight: FontWeight.w500),
    dividerColor: AppColors.border,
  ),
  scaffoldBackgroundColor: AppColors.page,
  bottomNavigationBarTheme: const BottomNavigationBarThemeData(
    backgroundColor: AppColors.nav,
    selectedItemColor: AppColors.active,
  ),
  bottomAppBarTheme: const BottomAppBarTheme(
    elevation: 0,
    color: AppColors.nav,
    padding: EdgeInsets.all(0),
  ),
  elevatedButtonTheme: ElevatedButtonThemeData(
    style: ElevatedButton.styleFrom(elevation: 0),
  ),
  badgeTheme: const BadgeThemeData(
    backgroundColor: AppColors.danger,
    padding: EdgeInsets.symmetric(horizontal: 5),
  ),
  // colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
  colorScheme: ColorScheme.fromSeed(seedColor: AppColors.primary),
  cupertinoOverrideTheme: const CupertinoThemeData(
    textTheme: CupertinoTextThemeData(), // This is required
    primaryColor: Colors.blueAccent,
  ),
  useMaterial3: true,
);
